﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace Maticsoft.Web.wap
{
    public partial class ProductCategory : BasePage
    {
        int _Cid = 3;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.QueryString["cid"], out _Cid))
            {
                _Cid = 3;
            }
        }

        protected string GetProduct()
        {
            BLL.Categorys cateBLL = new BLL.Categorys();
            DataSet proDS = cateBLL.GetList("parentId=" + _Cid + " order by OrderNo");
            StringBuilder strBuiler = new StringBuilder();
            foreach (DataRow dr in proDS.Tables[0].Rows)
            {
                strBuiler.Append("<li class=\"mui-col-xs-4 pad-5 mui-pull-left\"><div class=\" bg-white pad-5\">");
                strBuiler.Append("<a href=\"ProductList.aspx?cid=" + dr["CategoryId"] + "\"><img src=\"/uploadpic/category/" + dr["Pic"] + "\" style=\"width: 100%;\"></a>");
                strBuiler.Append("<h5 class=\"mui-text-center tc-gray\">" + dr["CategoryName"] + "</h5>");
                strBuiler.Append("</div></li>");
            }

            return strBuiler.ToString();
        }
    }
}